🎖️GitЯра🎖️
Node / meshtastic / Meshtastic-Android / files / core / repository / src / commonTest / kotlin / org / meshtastic / core / repository / ClientNotificationIdentityTest.kt
Displaying Raw • Download
core/repository/src/commonTest/kotlin/org/meshtastic/core/repository/ClientNotificationIdentityTest.kt 4d4070c8e1ed73a56ee2f054300a0f62e3fe2e62 (4d4070c8) Text, 2.24 KB
T8b949e/*
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Tff7b72package T7ee787org.meshtastic.core.repository
Tff7b72import T7ee787org.meshtastic.proto.ClientNotification
Tff7b72import T7ee787org.meshtastic.proto.DuplicatedPublicKey
Tff7b72import T7ee787org.meshtastic.proto.LogRecord
Tff7b72import T7ee787kotlin.test.Test
Tff7b72import T7ee787kotlin.test.assertEquals
Tff7b72import T7ee787kotlin.test.assertNotEquals
Tff7b72class T56d364ClientNotificationIdentityTest Tb4b4b4{
Tf0883e@Test
Tff7b72fun Td2a8ff`identity is stable across reply_id and time on an otherwise identical repeat`Tb4b4b4(Tb4b4b4) Tb4b4b4{
Tff7b72val Te6edf3first Tff7b72= Te6edf3ClientNotificationTb4b4b4(Te6edf3message Tff7b72= Ta5d6ff"Ta5d6ffLocation sharing is disabledTa5d6ff"Tb4b4b4, Te6edf3reply_id Tff7b72= T79c0ff1T79c0ff0T79c0ff0Tb4b4b4, Te6edf3time Tff7b72= T79c0ff1Te6edf3_000Tb4b4b4)
Tff7b72val Te6edf3second Tff7b72= Te6edf3ClientNotificationTb4b4b4(Te6edf3message Tff7b72= Ta5d6ff"Ta5d6ffLocation sharing is disabledTa5d6ff"Tb4b4b4, Te6edf3reply_id Tff7b72= T79c0ff2T79c0ff0T79c0ff0Tb4b4b4, Te6edf3time Tff7b72= T79c0ff2Te6edf3_000Tb4b4b4)
Te6edf3assertEqualsTb4b4b4(Te6edf3firstTb4b4b4.Te6edf3notificationIdTb4b4b4(Tb4b4b4)Tb4b4b4, Te6edf3secondTb4b4b4.Te6edf3notificationIdTb4b4b4(Tb4b4b4)Tb4b4b4)
Tb4b4b4}
Tf0883e@Test
Tff7b72fun Td2a8ff`identity differs when the message differs`Tb4b4b4(Tb4b4b4) Tb4b4b4{
Tff7b72val Te6edf3first Tff7b72= Te6edf3ClientNotificationTb4b4b4(Te6edf3message Tff7b72= Ta5d6ff"Ta5d6ffLocation sharing is disabledTa5d6ff"Tb4b4b4, Te6edf3reply_id Tff7b72= T79c0ff1T79c0ff0T79c0ff0Tb4b4b4)
Tff7b72val Te6edf3second Tff7b72= Te6edf3ClientNotificationTb4b4b4(Te6edf3message Tff7b72= Ta5d6ff"Ta5d6ffQuota exceededTa5d6ff"Tb4b4b4, Te6edf3reply_id Tff7b72= T79c0ff1T79c0ff0T79c0ff0Tb4b4b4)
Te6edf3assertNotEqualsTb4b4b4(Te6edf3firstTb4b4b4.Te6edf3notificationIdTb4b4b4(Tb4b4b4)Tb4b4b4, Te6edf3secondTb4b4b4.Te6edf3notificationIdTb4b4b4(Tb4b4b4)Tb4b4b4)
Tb4b4b4}
Tf0883e@Test
Tff7b72fun Td2a8ff`identity differs when the payload variant differs`Tb4b4b4(Tb4b4b4) Tb4b4b4{
Tff7b72val Te6edf3generic Tff7b72= Te6edf3ClientNotificationTb4b4b4(Te6edf3message Tff7b72= Ta5d6ff"Ta5d6ffCompromised keys detectedTa5d6ff"Tb4b4b4, Te6edf3level Tff7b72= Te6edf3LogRecordTb4b4b4.Te6edf3LevelTb4b4b4.Te6edf3WARNINGTb4b4b4)
Tff7b72val Te6edf3structured Tff7b72=
Te6edf3ClientNotificationTb4b4b4(
Te6edf3message Tff7b72= Ta5d6ff"Ta5d6ffCompromised keys detectedTa5d6ff"Tb4b4b4,
Te6edf3level Tff7b72= Te6edf3LogRecordTb4b4b4.Te6edf3LevelTb4b4b4.Te6edf3WARNINGTb4b4b4,
Te6edf3duplicated_public_key Tff7b72= Te6edf3DuplicatedPublicKeyTb4b4b4(Tb4b4b4)Tb4b4b4,
Tb4b4b4)
Te6edf3assertNotEqualsTb4b4b4(Te6edf3genericTb4b4b4.Te6edf3notificationIdTb4b4b4(Tb4b4b4)Tb4b4b4, Te6edf3structuredTb4b4b4.Te6edf3notificationIdTb4b4b4(Tb4b4b4)Tb4b4b4)
Tb4b4b4}
Tb4b4b4}
Served by rngit 1.5.0 - Generated in 0.04s